import glob, os
import shutil
def rename(dir, des):
	ii = 1
	pattern = "*.*"
	for pathAndFilename in glob.iglob(os.path.join(dir, pattern)):
		title, ext = os.path.splitext(os.path.basename(pathAndFilename))
		name_puzzle =  os.path.join(des, str(ii) + "_puzzle" + ext)
		name_puzzle_thumb = os.path.join(des, str(ii) + "_puzzle_thumb" + ext)
		try:
			shutil.copy(pathAndFilename, name_puzzle)
			shutil.copy(pathAndFilename, name_puzzle_thumb)
		except Exception:
			#do no thing
			print "Identical name" + pathAndFilename
		ii = ii + 1
        
rename(r'/Users/thiennguyen/Desktop/IOS Development/AKB48_Original/',r'/Users/thiennguyen/Desktop/IOS Development/AKB48')